﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLNhaThuoc.DAL;
using QLNhaThuoc.DTO;

namespace QLNhaThuoc.MyClass
{
    class LoaiThuocObserver
    {
        ThuocDA thuocDA = new ThuocDA();
        LoaiThuocDA loaiThuocDA = new LoaiThuocDA();

        public void update(LoaiThuoc loaiThuocCu, LoaiThuoc loaiThuocMoi)
        {
            loaiThuocDA.insert(loaiThuocMoi);
            thuocDA.updateThuoc("MaLoai", loaiThuocCu.MaLoai, loaiThuocMoi.MaLoai);
            loaiThuocDA.delete(loaiThuocCu);
        }
    }
}
